import request from '../utils/request';


// 获取职业资源列表
export const getCareerResourceListService = ({ articleType, limit }) => {
  // console.log(articleType, limit);
  return request.get('/career-resources/random', {
    params: {
      articleType,
      limit
    }
  });
};

// 获取职业资源详情
export const getSingleCareerResourceService = (id) => {
  return request.get(`/career-resources/${id}`)
}

// 点赞资源
export const likeCareerResourceService = (id) => {
  return request.post(`/career-resources/${id}/toggle-like`)
}

// 搜索资源
// 原代码中 params 对象使用扩展运算符展开 params，这一步是多余的，可直接传递 params
export const getCareerSearchService = (params) => {
  return request.get('/career-resources/search', { params });
}